<?php
/**
 * Created by PhpStorm.
 * User: Jennie
 * Date: 2017/8/29
 * Time: 22:58
 */

namespace app\api\controller\v1;


use app\api\validate\IDMustBePositiveInt;
use app\api\model\BannerItem as BannerItemModel;
use app\lib\exception\BannerMissException;

class BannerItem
{
    public function getBannerItem($id){
        (new IDMustBePositiveInt())->goCheck();
        $banner = BannerItemModel::all($id);
        if (!$banner){
            throw new BannerMissException();
        }
        return $banner;
    }
}